import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2022-09-26
 * Time: 20:35
 */
public class MathUtil {
    public int n;
    public MathUtil(){

    }

    public MathUtil(int n) {
        this.n = n;
    }

    public static boolean isPrime(int n){
        if(n<=1){
            System.out.println("不是素数");
            return false;
        }
        for(int i=2;i<=n/2;i++ ){
            if(n%i==0){
                System.out.println("不是素数");
                return false;
            }

        }
        System.out.println("是素数");
        return true;

    }
    public static boolean isPalindrome(int n){
            if(n<0){
                return false;
            }
            else if(n==0){
                return true;
            }
            int a=0;
            int b=0;
            int c=n;
        while(c!=0){
            a=c%10;
            b=b*10+a;
            c=c/10;
        }
        if(b==n){
            System.out.println("是回文数");
            return true;
        }

        System.out.println("不是回文数");
        return false;

    }

    public static void main(String[] args) {
     MathUtil  t=new MathUtil();
     boolean a=t.isPrime(121);
     MathUtil  t1=new MathUtil();

     boolean b=t1.isPalindrome(122221);

    }
}
